import React from "react";
import { createBrowserRouter } from "react-router";
import { RouterProvider } from "react-router/dom";
import Lazyload from "@/components/Lazyload";

const router = createBrowserRouter([
  {
    path: "/",
    element: <Lazyload>{React.lazy(() => import("@/layout"))}</Lazyload>
  },
  {
    path: "*",
    element: <Lazyload>{React.lazy(() => import("@/components/NotFound"))}</Lazyload>
  }
]);

const Router: React.FC = () => <RouterProvider router={router} />;

export default Router;
